/*j07c8riwYnz20MYibuDbtK8nt87if6pDPb4Mrcehsanw9qUrBkCzRJA7QgOZSeCo*/
import { ajax } from 'nc-lightapp-front';
import { pageConfig } from '../const';
import { setBatchBtnsEnable } from './buttonClick';
import { handleCheck_range } from '../../card/events/buttonClick';
import ampub from 'ampub';
const { utils } = ampub;
const { listUtils } = utils;
const { setListValue } = listUtils;
const { tableId, pagecode, url } = pageConfig;

export default function(props, config, pks) {
	let data = {
		allpks: pks,
		pagecode
	};
	//得到数据渲染到页面
	//得到数据渲染到页面
	ajax({
		url: url.queryPageUrl,
		data,
		success: (res) => {
			if (res && res.data && res.data[tableId] && res.data[tableId].rows && res.data[tableId].rows.length > 0) {
				//处理盘点范围多语
				res.data[tableId].rows.map((row) => {
					handleCheck_range.call(this, row.values.check_range, true);
				});
			}
			setListValue.call(this, props, res);
			setBatchBtnsEnable.call(this, props, tableId);
		}
	});
}

/*j07c8riwYnz20MYibuDbtK8nt87if6pDPb4Mrcehsanw9qUrBkCzRJA7QgOZSeCo*/